package com.itheima.dao;

import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {

    @Select("select * from account")
   List<Account> queryAll();

    // in  进账   out 出账
    @Update("update account set money=money-#{money} where name=#{name}")
    void outMoney(@Param("name") String outName,@Param("money") double money);

    @Update("update account set money=money+#{money} where name=#{name}")
    void inMoney(@Param("name") String inName,@Param("money") double money);
}
